package produce

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type EquipmentRouter struct {}

// InitEquipmentRouter 初始化 设备 路由信息
func (s *EquipmentRouter) InitEquipmentRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	equipmentRouter := Router.Group("equipment").Use(middleware.OperationRecord())
	equipmentRouterWithoutRecord := Router.Group("equipment")
	equipmentRouterWithoutAuth := PublicRouter.Group("equipment")
	{
		equipmentRouter.POST("createEquipment", equipmentApi.CreateEquipment)   // 新建设备
		equipmentRouter.DELETE("deleteEquipment", equipmentApi.DeleteEquipment) // 删除设备
		equipmentRouter.DELETE("deleteEquipmentByIds", equipmentApi.DeleteEquipmentByIds) // 批量删除设备
		equipmentRouter.PUT("updateEquipment", equipmentApi.UpdateEquipment)    // 更新设备
	}
	{
		equipmentRouterWithoutRecord.GET("findEquipment", equipmentApi.FindEquipment)        // 根据ID获取设备
		equipmentRouterWithoutRecord.GET("getEquipmentList", equipmentApi.GetEquipmentList)  // 获取设备列表
	}
	{
	    equipmentRouterWithoutAuth.GET("getEquipmentPublic", equipmentApi.GetEquipmentPublic)  // 设备开放接口
	}
}
